build: Add more useful warning flags
authorBenjamin Otte <otte@redhat.com>
Thu, 5 Mar 2020 02:58:29 +0000 (03:58 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 5 Mar 2020 06:56:28 +0000 (07:56 +0100)
I found those on the interwebs and decided they are useful.

gdk/gdkrgbaprivate.h
meson.build

index 5126f573556106abd00d9db39e73d9fe20cbfa68..fc355f59138ecab1a71b781867d21d2d63cfbb2b 100644 (file)
@@ -28,7 +28,7 @@
                                         ((c) >= 'a' && (c) <= 'f') ? ((c)-'a'+10) : \
                                         ((c) >= '0' && (c) <= '9') ? ((c)-'0') : \
                                         -1))
-#define _GDK_RGBA_SELECT_COLOR(_str, index3, index6) _GDK_RGBA_DECODE (sizeof(_str) <= 4 ? (_str)[index3] : (_str)[index6])
+#define _GDK_RGBA_SELECT_COLOR(_str, index3, index6) (sizeof(_str) <= 4 ? _GDK_RGBA_DECODE ((_str)[index3]) : _GDK_RGBA_DECODE ((_str)[index6]))
 #define GDK_RGBA(str) ((GdkRGBA) {\
     ((_GDK_RGBA_SELECT_COLOR(str, 0, 0) << 4) | _GDK_RGBA_SELECT_COLOR(str, 0, 1)) / 255., \
     ((_GDK_RGBA_SELECT_COLOR(str, 1, 2) << 4) | _GDK_RGBA_SELECT_COLOR(str, 1, 3)) / 255., \
index 2ba1516d7e9b137507f8375276525322b5b00744..dea88448b7f7c2166f93391702e50485f959fe2e 100644 (file)
@@ -238,12 +238,15 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
   test_cflags = [
     '-fno-strict-aliasing',
     '-Wcast-align',
+    '-Wduplicated-branches',
+    '-Wduplicated-cond',
     '-Wformat=2',
     '-Wformat-nonliteral',
     '-Wformat-security',
     '-Wignored-qualifiers',
     '-Wimplicit-function-declaration',
     '-Wlogical-op',
+    '-Wmisleading-indentation',
     '-Wmissing-format-attribute',
     '-Wmissing-include-dirs',
     '-Wmissing-noreturn',